﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StructDataSearchView.aspx.cs" 
Inherits="XMK.Tadong.Web.Views.DataSearch.StructDataSearchView" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>结构化数据检索</title>
    <link href="../../weblib/jqueryui-autocomplete/themes/ui-lightness/jquery.ui.all.css"
        rel="stylesheet" type="text/css" />
    <link href="../../weblib/jquery.easyui/themes/default/easyui.css" rel="stylesheet"
        type="text/css" />
    <link href="../../weblib/jquery.easyui/themes/icon.css" rel="stylesheet" type="text/css" />
    <script src="../../webjs/core/config.js" type="text/javascript"></script>
    <script src="../../weblib/jquery/jquery-1.8.0.min.js" type="text/javascript"></script>
    <script src="../../weblib/jquery/jquery.adaptor.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../weblib/jquery.easyui/jquery.easyui.min.js"></script>
    <link href="../../weblib/skins/searchStyle.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        
        body
        {
            font-size:12px;
            }
        
        #head
        {
            margin-bottom: 10px;
        }
        
        .fm
        {
            clear: both;
            position: relative;
            z-index: 297;
        }
        
        .s_ipt_wr
        {
            width: 380px;
            height: 30px;
            display: inline-block;
            margin-right: 5px;
            background-position: 0 -96px;
            border: 1px solid #b6b6b6;
            border-color: #7b7b7b #b6b6b6 #b6b6b6 #7b7b7b;
            vertical-align: top;
        }
        
        .s_ipt
        {
            width: 370px;
            height: 22px;
            font: 16px/22px arial;
            margin: 5px 0 0 7px;
            padding: 0;
            background: #fff;
            border: 0;
            outline: 0;
            -webkit-appearance: none;
        }
        
        .bg
        {
            background-image: url(http://s1.bdstatic.com/r/www/cache/static/global/img/icons_4879d3b8.png);
            background-repeat: no-repeat;
            _background-image: url(http://s1.bdstatic.com/r/www/cache/static/global/img/icons_5a07887b.gif);
            background-repeat: no-repeat;
        }
        
        .s_btn
        {
            width: 95px;
            height: 32px;
            padding-top: 2px;
            font-size: 14px;
            padding: 0;
            background-color: #ddd;
            background-position: 0 -48px;
            border: 0;
            cursor: pointer;
        }
        
        .s_btn_wr
        {
            width: 97px;
            height: 34px;
            display: inline-block;
            background-position: -120px -48px;
            z-index: 0;
            vertical-align: top;
        }
        
        #container
        {
            word-break: break-all;
            word-wrap: break-word;
        }
        .container_l
        {
            width: 1222px;
        }
        
        #content_left
        {
            width: 636px;
            float: left;
            padding-left: 35px;
        }
        
        .ec_pp_top
        {
            margin-bottom: 20px;
            width: 540px;
            overflow: hidden;
        }
        
        .ec_pp_top .ec_title
        {
            width: 100%;
            overflow: hidden;
        }
        
        .t
        {
            font-weight: normal;
            font-size: medium;
            margin-bottom: 1px;
        }
        
        .ec_nowrap
        {
            white-space: nowrap;
            overflow: hidden;
        }
        
        .ec_pp_top .ec_title h3 a
        {
            zoom: 1;
        }
        
        a:-webkit-any-link
        {
            color: -webkit-link;
            text-decoration: underline;
            cursor: auto;
        }
        
        .ec_desc
        {
            line-height: 19px;
        }
        
        .ec_font_small
        {
            font-size: small;
        }
        
        .ec_meta
        {
            margin-top: 1px;
            line-height: 18px;
        }
        
        .ec_date, .ec_url
        {
            color: green;
        }
        
        #content_left
        {
            width: 636px;
            float: left;
            padding-left: 15px;
        }
        
        h3
        {
            display: block;
            margin: 0;
            padding: 0;
            list-style: none;
        }
        
        a
        {
            color: Blue;
            text-decoration: underline;
        }
        a:hover
        {
            color: #004988;
            text-decoration: underline;
            cursor: pointer;
        }
        .menulist
        {
            padding: 0px 10px;
            border: 1px solid #ccc;
            line-height: 28px;
            height: 26px;
            background: #f7f7f7;
        }
        
        #commendcontainer
        {
            padding: 10px;
            margin: 15px 0;
            border: 1px solid #4c95c7;
            height: 60px;
            display: none;
        }
        .search_header
        {
            height: 30px;
        }
        .search_header_left
        {
            float: left;
            width: 240px;
        }
        .search_header_right
        {
            margin-left: 250px;
            padding-right: 15px;
            line-height: 28px;
        }
        ul.search_tab_li
        {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        ul.search_tab_li li
        {
            cursor: pointer;
            float: left;
            width: 110px;
            border: 1px solid #4c95c7;
            border-bottom: none;
            text-align: center;
            background: #dbe5ee;
            line-height: 29px;
            height: 29px;
        }
        ul.search_tab_li li.current
        {
            background: #f9fcfe;
        }
        .search_list
        {
            min-height:80px;
            padding: 10px;
            border: 1px solid #4c95c7;
        }
        #searchCount
        {
            color: #828080;
            text-align: right;
        }
        
        .sarch_logo
        {
            background: url(../../weblib/skins/images/search_logo.gif) no-repeat;
            width: 36px;
            height: 35px;
            float: left;
            padding-right: 10px;
        }
        .search_input
        {
            float: left;
            position: relative;
        }
        #search_type
        {
            background:#fff;
            width: 70px;
            height: 20px;
            padding:7px 5px 3px;
            position: absolute;            
            top: 1px;
            left: 300px;
        }
    </style>

    <script type="text/javascript">
        $(function () {
            $("h3 a").click(function () {
                var tabEngName = $(this).attr("id").toString();
                var tableCNName = $(this).attr("title");
                var procName = $(this).attr("proc");
                var keywText = $("#txtKeyword").val();

                $.post("../../Handlers/StructTableDictHandler.ashx?optype=getdict",
                {
                    tab_code: tabEngName
                },
                function (data) {

                    var cols = [];
                    for (var i = 0; i < data.length; i++) {
                        cols.push({
                            field: data[i].Col_Eng_Name.toUpperCase(),
                            title: data[i].Col_CN_Name,
                            width: data[i].Col_Width,
                            align: data[i].Col_Align
                        });
                    }

                    var icols = [];
                    icols.push(cols);

                    $("#tableWin").window({ title: tableCNName }).window("open");

                    $('#dgTable').datagrid({
                        url: '../../Handlers/StructTableDictHandler.ashx?optype=querydata',
                        columns: icols,
                        method: "post",
                        queryParams:
                        {
                            proc: procName,
                            kw : keywText
                        },
                        rownumbers: true,
                        animate: true,
                        collapsible: true,
                        pageSize: 10,
                        pagination: true,
                        singleSelect: true
                    });

                    //设置分页控件  
                    var p = $('#dgTable').datagrid('getPager');
                    $(p).pagination({
                        pageSize: 10, //每页显示的记录条数，默认为10  
                        pageList: [10, 15, 20], //可以设置每页记录条数的列表  
                        beforePageText: '第', //页数文本框前显示的汉字  
                        afterPageText: '页    共 {pages} 页',
                        displayMsg: ''
                        /*displayMsg: '当前显示 {from} - {to} 条记录   共 {total} 条记录'
                        */
                    });
                });
            });
        });
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div id="head">
            <div style="text-align: left; width: 740px;">
                <div style="width: 740px; height: 38px; margin: 30px 0 20px;">
                    <div class="sarch_logo">
                    </div>
                    <div class="search_input">
                        <span class="s_ipt_wr">
                            <asp:TextBox runat="Server" CssClass="s_ipt" ID="txtKeyword"></asp:TextBox>
                        </span><span class="bg s_btn_wr">
                            <asp:Button runat="Server" ID="btnSearch" CssClass="bg s_btn" Text="搜索一下" OnClick="btnSearch_Click" />
                        </span>
                        
                    </div>
                </div>
            </div>
            <div style="clear: both; height: 1px;">
            </div>
        </div>
        <div class="searchtab">
            <div class="search_header">
                <div class="search_header_left">
                    <ul class="search_tab_li">
                        <li class="current" >结构化数据</li>
                    </ul>
                </div>
                <div class="search_header_right">
                    <div runat="server" id="searchCount">
                    </div>
                </div>
            </div>
            <div class="search_list">
                <div id="tab1">
                    <div runat="Server" id="divContainer">
                    </div>
                    <webdiyer:AspNetPager ID="AspNetPager1" CssClass="paginator"   
                       CurrentPageButtonClass="cpb" runat="server" AlwaysShow="False" 
                       FirstPageText="首页"  LastPageText="尾页" NextPageText="下一页"  
                       PageSize="15" PrevPageText="上一页"  ShowCustomInfoSection="Right" 
                       OnPageChanged="AspNetPager1_PageChanged"
                       ShowInputBox="Never"   CustomInfoTextAlign="Left" LayoutType="Div"  >
                    </webdiyer:AspNetPager>
                </div>
                
            </div>
        </div>
    </form>

    <div id="tableWin" class="easyui-window"  style="width:600px; height:500px;" closed="true" collapsible="false" >
        <table  id="dgTable"></table>
    </div>
</body>
</html>
